@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <link rel="stylesheet" href="/lib/layer/theme/default/layer.css"/>
    <script type="text/javascript" src="/lib/layer/layer.js"></script>
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><a href="/activity/list">社区活动</a></li>
                <li class="active">社区活动列表</li>
            </ul>
        </div>
        <div class="main-content">
            <div class="btn-toolbar list-toolbar">
                <form class="form-inline" action="" method="get">
                    <a href="/activity/add"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" ><i class="fa fa-plus"></i> 新增</button></a>
                    <div class="form-group">
                        <input type="text" class="form-control" name="title" placeholder="活动标题" value="">
                    </div>
                    <button type="submit" class="btn btn-default">筛选</button>
                </form>
            </div>
            <div class="row">
                <div class="col-sm-12 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading no-collapse">课程列表</div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>活动标题</th>
                                <th>封面图</th>
                                <th>开始时间</th>
                                <th>结束时间</th>
                                <th>排序值</th>
                                <th>活动状态</th>
                                <th>操作者</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($data as $v)
                                <tr>
                                    <td>{{$v->id}}</td>
                                    <td>{{$v->title}}</td>
                                    <td><img src = "{{env('IMG_URL')}}{{$v->cover_url}}" width="100"/></td>
                                    <td>{{$v->start_time}}</td>
                                    <td>{{$v->end_time}}</td>
                                    <td>{{$v->orderby}}</td>
                                    <td>{{$v->state == 1 ?"进行中☻":'已结束☃'}}</td>
                                    <td>{{getUserName($v->opertion_user_id)->name}}</td>
                                    <td><a href="/activity/edit/{{$v['id']}}">编辑</a> | <a href="/activity/del/{{$v['id']}}">删除</a></td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>

                    </div>
                    {{$data->appends(['title'=>$title])->render()}}
                </div>
            </div>
          
        </div>
    </div>
  
@endsection